<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="s" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="<s:url value="/assets/web/css/base.css"></s:url>"><!-- 基本框css -->
    <link rel="stylesheet" href="<s:url value="/assets/web/css/login/bootstrap.min.css?v=3.3.6"></s:url>">
    <link rel="stylesheet" href="<s:url value="/assets/web/css/base_nav.css"></s:url>">
    <link rel="stylesheet" href="<s:url value="/assets/web/css/configNode/configNode.css"></s:url>">
    <title>确认节点信息</title>
    <style>
        /* 显示区域边距 */
        #content-main {
            padding: 10px 0px 0;
            padding-bottom: 50px;
        }
        /* 通用按钮 */

	 .general-btn {
	   width: 60px;
	   height: 30px;
	   background-color: #337ab7;
	   color: #F2F2F2;
	   border-radius: 10px;
	   font-size: 13px;
	   color:#fff;
	   line-height: 30px;
	   border:none;
	   cursor: pointer;
	 }
    </style>
</head>

<body class="bgcolor">
<%@ include file="/WEB-INF/views/modules/commons/nav.jsp" %>
<%@ include file="/WEB-INF/views/modules/commons/menu.jsp" %>
<table></table>
<!-- 窗口显示区 -->
<div class="av row J_mainContent" id="content-main">
    <div class="container">
        <div class="config">
            <p class="config-nav">
               <span>
                      <font size="4">项目基本信息：</font>
                </span>
            </p>
            <div class="config-title">
                <p>
                    <span>项目名称 :</span>
                    <span>${newProjects.name}</span>
                </p>
                <p>
                    <span>责任单位 :</span>
                    <span>${newProjects.resDept}</span>
                </p>
                <p class="hide-content">
                    <span>分管领导 : </span>
                    <span>${newProjects.resUser}</span>
                </p>

                <p class="hide-content">
                    <span>性质类型: </span>
                       <span>
                       <c:if test="${newProjects.natureType=='0'}">
                           政府投资类
                       </c:if>
                        <c:if test="${newProjects.natureType=='1'}">
                            企业投资类
                        </c:if>
                        <c:if test="${newProjects.natureType=='2'}">
                            土地收储类
                        </c:if>
                       </span>
                </p>
                <p class="hide-content">
                    <span>投入资金 : </span>
                    <span>${newProjects.money}</span>
                    <span>万元</span>
                </p>
                <p class="hide-content">
                    <span>初步选址 : </span>
                    <span>${newProjects.address}</span>
                </p>
                <p class="hide-content">
                    <span>项目描述 : </span>
                    <span>${newProjects.describes}</span>
                </p>
                <p class="hide-content">
                    <span>联系人 : </span>
                    <span>${newProjects.contactName}</span>
                </p>
                <p class="hide-content">
                    <span>电话号码 : </span>
                    <span>${newProjects.contactPhone}</span>
                </p>
                <p class="hide-content">
                    <span>行业分类 : </span>
                       <span>
                       <c:if test="${newProjects.industryType=='1001'}">
                           旅游特色小镇项目
                       </c:if>
                        <c:if test="${newProjects.industryType=='1002'}">
                            工业项目
                        </c:if>
                        <c:if test="${newProjects.industryType=='1003'}">
                            交通
                        </c:if>
                       <c:if test="${newProjects.industryType=='1004'}">
                           城镇基础设施
                       </c:if>
                       <c:if test="${newProjects.industryType=='1005'}">
                           安置房项目
                       </c:if>
                        <c:if test="${newProjects.industryType=='1006'}">
                            社会事业项目
                        </c:if>
                        <c:if test="${newProjects.industryType=='1007'}">
                            商住项目
                        </c:if>
                       <c:if test="${newProjects.industryType=='1008'}">
                           农林水利环保生态项目
                       </c:if>
                       </span>
                </p>
                <p class="hide-content">
                    <span>项目分类 : </span>
                       <span>
                      <c:if test="${newProjects.projectType=='2001'}">
                          计划新开工项目
                      </c:if>
                       <c:if test="${newProjects.projectType=='2002'}">
                           结转项目
                       </c:if>
                       </span>
                </p>
                <p class="hide-content">
                    <span>按进度分类 : </span>
                       <span>
                       <c:if test="${newProjects.schedCode=='3001'}">
                           前期项目
                       </c:if>
                        <c:if test="${newProjects.schedCode=='3002'}">
                            开工项目
                        </c:if>
                        <c:if test="${newProjects.schedCode=='3003'}">
                            在建提速
                        </c:if>
                        <c:if test="${newProjects.schedCode=='3004'}">
                            竣工项目
                        </c:if>
                       </span>
                </p>
                <p class="open-list">展开更多信息 v</p>
            </div>
            <p class="config-nav">
               <span>
                      <font size="4">配置节点信息：</font>
                </span>
            </p>
            <!-- 项目建议书 -->
            <c:forEach items="${nodesList}" var="np">
                <div class="config-content">
                    <div class="jd-block">
                        <p>
                        <div class="element1 left">
                            <div class="child1"></div>
                        </div>
                       <span class="total-title">${np.nodeId}&nbsp;${np.nodeName} &nbsp;&nbsp;
                         <c:if test="${np.state=='0'}">
                         <select id="state${np.idFlag}">
                             <option value="">---是否需要此节点---</option>
                             <option value="1">---需要---</option>
                             <option value="2">---不需要---</option>
                         </select>
                          &nbsp;&nbsp;&nbsp;&nbsp;<button id="" class="general-btn" onclick="configBigNode(${np.nodeId},${np.idFlag})" >确定</button>
                         </c:if>
                         <c:if test="${np.state=='1'}">
                             此节点:需要
                         </c:if>
                         <c:if test="${np.state=='2'}">
                             此节点:不需要
                         </c:if>

                       </span>
                       </p>

                       <ul class="drop-list">
                        <c:if test="${np.state !='2'}">
                        <c:forEach items="${np.childNodesList}" var="np2">
                           <li>
                      <span class="open"> ${np2.nodeId} ${np2.nodeName}&nbsp;&nbsp;&nbsp;
                        <em>∧</em>
                      </span>
                                        <ul class="clear-list">
                                            <li>
                                                责任人:${np2.resUser}-${np2.resDept}
                                            </li>
                                            <li>
                                                经办人: ${np2.operatorUser}-${np2.resDept}

                                            </li>
                                            <li>
                                                计划用时： <c:if test="${np2.state =='0'}">
                                                <input type="number" id="planTime${np2.nodeIds}" min="0"
                                                       value="${np2.planTime}" readonly="readonly"> &nbsp;&nbsp;天
                                            </c:if>
                                                <c:if test="${np2.state !='0'}">
                                                    ${np2.planTime}&nbsp;&nbsp;天
                                                </c:if>
                                            </li>

                                            <%--<c:if test="${np2.state =='0'}">
                                                <li class="confirm" onclick="copyText(${np2.nodeIds},${np2.nodeId})">
                                                    确定
                                                </li>
                                            </c:if>--%>
                                        </ul>
                                    </li>
                                </c:forEach>
                            </c:if>
                        </ul>
                    </div>
                    <!-- 2 -->
                </div>
            </c:forEach>
            <!-- 提交、修改按钮 -->
            <div class="button-list">
                <!-- <a class="submit" href="#">确定</a> -->
                <%--<a class="revise" href="#">返回修改</a>--%>
            </div>
        </div>
    </div>
</div>


<script src="<s:url value="/assets/web/js/jquery.min.js"></s:url>"></script>
<script src="<s:url value="/assets/js/bootstrap.js"></s:url>"></script>
<script src="<s:url value="/assets/web/js/baseAPI.js"></s:url>"></script>
<script src="/assets/web/common/bootstrapvalidator/dist/js/bootstrapValidator.js"></script>

<script>
    // 下拉列表
    $(".drop-list").dropList();

    // 展开更多
    $(".open-list").click(function () {

        if ($(".hide-content").is(":hidden")) {
            $(".hide-content").css("display", "block");
            $(this).text("隐藏部分内容 ∧");
        } else {
            $(".hide-content").css("display", "none");
            $(this).text("展开更多信息 v");
        }
    });
    
    function copyText(nodeIds,nodeId){
    	var projectId="${newProjects.sysId}";
    	var planTime=$("#planTime"+nodeIds).val();
         if(planTime==""){
    		alert("计划时间不能为空！");
    		return ;
    	}

    	  $.ajax({
             type: "POST",
             url: "/accraditation/configNode",
             dataType: "json",
             data: {projectId:projectId,planTime:planTime,nodeId:nodeId},
             success: function (model) {
                 alert(model.msp);
                 if(model.status){
                	 window.location.reload();
                 }

             },
             error: function (model) {
             }
         });

    }
    function configBigNode(nodeId,idFlag){
    	var projectId="${newProjects.sysId}";
    	var state=$("#state"+idFlag).val();
    	if(state==""){
            alert("请选择是否需要状态值");
            return ;
        }
    	 $.ajax({
             type: "POST",
             url: "/accraditation/configBigNode",
             dataType: "json",
             data: {projectId:projectId,state:state,nodeId:nodeId},
             success: function (model) {
                 alert(model.msp);
                 if(model.status){
                	 window.location.reload();
                 }

             },
             error: function (model) {
             }
         });
    }
</script>
</body>
</html>